home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 6 / CU Amiga Magazine's Super CD-ROM 06 (1996)(EMAP Images)(GB)(Track 1 of 4)[!][issue 1997-01].iso / cucd / prog / mui / muirexx2.2 / demos / muirexxbuild / ask_comm.rexx < prev    next >
OS/2 REXX Batch file  |  1996-09-29  |  3KB  |  102 lines

  1. /* */
  2. options results
  3. parse arg comm' 'name
  4.  
  5. MUIA_Frame =                           0x8042ac64 /* V4  i.. LONG              */
  6. Disabled =                        0x80423661 /* V4  isg BOOL              */
  7. Image_FontMatch =                 0x8042815d /* V4  i.. BOOL              */
  8.  
  9. TRUE = 1
  10. FALSE = 0
  11.  
  12. address BUILD
  13.  
  14. cycle ID L2
  15. type = result
  16.  
  17. select
  18.     when comm = 'SET' then do
  19.         if name = '' then do
  20.             popasl ID S7
  21.             name = result
  22.         end
  23.         if index(name,'.info') > 0 then do
  24.             name = substr(name,1,index(name,'.info')-1)
  25.             type = 'Icon'
  26.             check ID C1 ATTRS Disabled TRUE
  27.             cycle ID L2 LABEL 'Icon'
  28.         end
  29.         check ID C1
  30.         if ~result then TRANS = ''
  31.         group ID GIMG
  32.             select
  33.                 when type = 'Icon' then switch ID AIMG ICON name
  34.                 when type = 'Picture' then switch ID AIMG PICT name TRANS
  35.                 when type = 'None' then switch ID AIMG ATTRS MUIA_Frame 0
  36.                 otherwise nop
  37.             end
  38.         endgroup
  39.         popasl ID S7 CONTENT name
  40.     end
  41.     when comm = 'IMAGE' then do
  42.         select
  43.             when type = 'Icon' then do
  44.                 check ID C1 ATTRS Disabled TRUE
  45.             end
  46.             when type = 'Picture' then do
  47.                 check ID C1 ATTRS Disabled FALSE
  48.             end
  49.             when type = 'None' then do
  50.                 check ID C1 ATTRS Disabled TRUE
  51.             end
  52.             otherwise nop
  53.         end
  54.         popasl ID S7 CONTENT ''
  55.     end
  56.     when comm = 'ISET' then do
  57.         cycle ID R1
  58.         gspec = result
  59.         poplist ID S8
  60.         sname = result
  61.         sval = name
  62.         if gspec = 6 then do
  63.             name = ''
  64.             call open('images','build:images.lst','R')
  65.             do while ~eof('images')
  66.                 line = readln('images')
  67.                 if line = '' then leave
  68.                 parse var line vname '=' value .
  69.                 if sname = '' then do
  70.                     if value = sval then do
  71.                         sname = vname
  72.                         poplist ID S8 CONTENT sname
  73.                         leave
  74.                     end
  75.                 end
  76.                 else do
  77.                     if index(vname,sname) > 0 then do
  78.                         sval = value
  79.                         leave
  80.                     end
  81.                 end
  82.             end
  83.             call close('images')
  84.         end
  85.         else poplist ID S8 CONTENT sval
  86.         group ID GIMG
  87.             image ID AIMG SPEC '"'gspec':'sval'"' ATTRS Image_FontMatch TRUE MUIA_Frame 0
  88.         endgroup
  89.     end
  90.     when comm = 'CLASS' then do
  91.         check ID C1
  92.         if result then dirlist ID D1 PATH '"SYS:Classes/Gadgets"'
  93.         else dirlist ID D1 PATH '"MUI:Libs/MUI"'
  94.         string ID S6 CONTENT ''
  95.     end
  96.     when comm = 'CSET' then do
  97.         string ID S6 CONTENT substr(name,lastpos('/',name)+1)
  98.     end
  99.     otherwise nop
  100. end
  101. exit
  102.